<?php


Route::get('/login','AuthController@index');
Route::post('/login','AuthController@token');
Route::get('/user/init','AuthController@initUser');
Route::get('/','HomeController@index');
Route::get('/users','AdminController@index');
Route::get('/permissions','PermissionController@index');
Route::get('/roles','RoleController@index');


Route::group(['middleware' => ['admin_auth']],function(){
    //菜单列表
    Route::get('/menus','PermissionController@menus');

    //管理员模块
    Route::get('/users/list','AdminController@list');
    Route::post('/users/store','AdminController@store');
    Route::post('/users/del','AdminController@del');

    //权限模块
    Route::get('/permission/list','PermissionController@list');
    Route::post('/permission/store','PermissionController@store');
    Route::post('/permission/del','PermissionController@del');

    //角色模块
    Route::get('/role/list','RoleController@list');
    Route::post('/role/store','RoleController@store');
    Route::post('/role/del','RoleController@del');

    //素材模块
    Route::group(['prefix' => 'material'],function(){
        Route::get('/list','MaterialController@list');
        Route::get('/item','MaterialController@item');
        Route::post('/store','MaterialController@store');
        Route::post('/del','MaterialController@del');
    });

    //数据模块 有好货
    Route::group(['prefix' => 'data'],function(){
        Route::post('/yhh/list_store','YhhController@listStore');
        Route::post('/yhh/item','YhhController@item');
        Route::post('/yhh/store','YhhController@store');
        Route::get('/yhh/exists','YhhController@exists');
    });

    //文章模块
    Route::group(['prefix' => 'article'],function(){
        Route::get('/list','ArticleController@list');
        Route::get('/item','ArticleController@item');
        Route::post('/store','ArticleController@store');
        Route::post('/del','ArticleController@del');
        Route::post('/status','ArticleController@status');
    });

    //粉丝模块
    Route::group(['prefix' => 'fans'],function(){
        Route::any('/store','FansController@fansStore');
        Route::any('/register','FansController@register');
        Route::any('/anchor/sync','FansController@syncAnchors');
    });

});
